package top.dprkshow.springboothelloworld.api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author HAN Bing
 * @date 2021/6/24
 */
@RestController
@Api(tags = {"测试tags1在接口类"})
public class HelloWorld {

    Logger logger = LoggerFactory.getLogger(HelloWorld.class);

    @ApiOperation(value = "测试value在say", notes = "测试notes在say")
    @GetMapping("/say")
    public String say() {
        logger.info("测试Logback情infoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfoinfo");
        logger.error("测试Logback情况errorerrorerrorerrorerrorerrorerrorerrorerrorerrorerrorerro");
        return "Hello World22";
    }

    @GetMapping("/globaldata")
    // 取出ModelAttribute全局数据
    public Map getGlobalData(@ModelAttribute("md") Map map) {
        return map;
    }

}
